import { Component, OnInit } from '@angular/core';
import { StoreService } from 'src/services/store.service';
import { UiService } from 'src/services/ui.service';

@Component({
  selector: 'app-entityview',
  templateUrl: './entityview.component.html',
  styleUrls: ['./entityview.component.scss']
})
export class EntityviewComponent implements OnInit {

  constructor(public ui: UiService, public store: StoreService) { }

  ngOnInit(): void {
  }
  accordionTypeEmbed = 'embed'
  restrictOneOpen = true

  actorIsCollapsed = true
  clueIsCollapsed = false
  eventIsCollapsed = false
  groupIsCollapsed = false
  locationIsCollapsed = false
  taskIsCollapsed = false
  stuffIsCollapsed = false

  select(item, t) {
    console.log(item);
    console.log(t);
    this.store.currentEntity = item
    if (t == 'panorama' || t === 'express')
      this.ui.openinfo(item.Name, t, item)
    else
      this.ui.openinfo(item.Id, t, item)
  }
  active(item) {
    console.log(item);
    this.ui.activePanel = item
  }
  showDestiny(item) {
    this.ui.openinfo('destiny:' + item.Name + '(' + item.Id + ')', 'destiny', item)
  }
  log(e) {
    console.log(e);
    console.log(e.dragData.item);
  }
}
